package com.cf.dao;

import com.cf.entity.Role;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface RoleDao {
    //查询所有的角色对象
    public List<Role> selectRoles();
    //按条件查询所有的角色对象
    public List<Role> selectRolesByName(Map map);
    //根据roleid删除掉role_power表中的powerid
    public int deletePowerByRoleId(@Param("roleid") long roleid);
    //向role_power表中添加数据
    public int addRoleAndPower(@Param("roleid") long roleid,@Param("powerid") long powerid);
    //根据用户编号查询角色
    public List<Role> selectByUserId(long id);
    //根据id逻辑删除角色
    public int deleteRole(long roleid);
    //根据id修改
    public int updateById(Role role);

    //通过roleid查找
    public Role selectByRoleid(long roleid);
}
